/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



import AlmacenTemp.AlmacenTemp;
import AlmacenTemp.PagTemp;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author linux1
 */
public class PruebaAlmacen {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws InterruptedException {

        PagTemp pag1 = new PagTemp("http://111download.oracle.com/javase/6/docs/api/", "<html1\n\n\tasdf>");
        PagTemp pag2 = new PagTemp("http://222download.igor.com/javase/6/docs/api/", "<html2\nasdfasdf>");
        PagTemp pag3 = new PagTemp("http://333otra.com/hola?=1", "<html3\nasdfasdfasdf>");
        PagTemp pag4 = new PagTemp("http://444asdf.asdf/asdf/asdf.asdf?=asdf", "<html4 \n\n asd\tfasdfasdfasdf>");
        PagTemp pag5 = new PagTemp("http://www.vagos.es/showthread.php?t=972281", "<html5\nasdfasdfasdfasdfasdf>");
        PagTemp pag6 = new PagTemp("http://222download.igor.com/javase/6/docs/api/", "<_____NUEVA VERSION DE 2____asdfasdf>");
        try {
            AlmacenTemp.guardar(pag1);
            Thread.sleep(1100);
            AlmacenTemp.guardar(pag2);
            Thread.sleep(1100);
            AlmacenTemp.guardar(pag3);
            Thread.sleep(1100);
            AlmacenTemp.guardar(pag4);
            Thread.sleep(1100);
            AlmacenTemp.guardar(pag5);
            Thread.sleep(1100);
            AlmacenTemp.guardar(pag6);
        } catch (IOException ex) {
            Logger.getLogger(PruebaAlmacen.class.getName()).log(Level.SEVERE, null, ex);
        }


        PagTemp pag;
        while ( ( pag = AlmacenTemp.sacar() ) != null ) {
            System.out.println("***" + pag.getURL() + "***");
            System.out.print(pag.getHTML());
        }
    }
}
